package com.uubx.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * (Insurance)实体类
 *
 * @author makejava
 * @since 2020-12-30 20:07:10
 */
@Table(name="insurance")  //映射表名
@ApiModel(description = "Insurance数据")
public class Insurance implements Serializable {
    private static final long serialVersionUID = 317187772899112511L;
    /**
     * 保险id
     */
    @Id
    @ApiModelProperty(value = "保险id")
    @GeneratedValue(strategy = GenerationType.IDENTITY) //配置返回自动增长的主键
    private Long id;
    /**
     * 保险名字
     */
    @ApiModelProperty("保险名字")
    @Column(name="name")
    @NotEmpty(message = "保险名字不能为空")
    private String name;
    /**
     * 保险类型,0代表交强险,1代表商业险
     */
    @ApiModelProperty("保险类型,0代表交强险,1代表商业险")
    @Column(name="type")
    private Integer type;
    /**
     * 保险购买价格
     */
    @ApiModelProperty("保险购买价格")
    @Column(name="price")
    private BigDecimal price;
    /**
     * 保险状态,1-正常，2-下架，3-删除
     */
    @ApiModelProperty("保险状态,1-正常，2-下架，3-删除")
    @Column(name="status")
    private Integer status;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间",hidden=true)
    @Column(name="created")
    private Date created;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间",hidden=true)
    @Column(name="updated")
    private Date updated;


    public Insurance() {

    }

    public Insurance(@NotEmpty(message = "保险名字不能为空") String name, Integer type, BigDecimal price, Integer status, Date created, Date updated) {
        this.name = name;
        this.type = type;
        this.price = price;
        this.status = status;
        this.created = created;
        this.updated = updated;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Date getUpdated() {
        return updated;
    }

    public void setUpdated(Date updated) {
        this.updated = updated;
    }
}